﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:MetroUI"
    >

    <Style TargetType="{x:Type local:MetroDialog}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:MetroDialog}">

                    <Grid >

                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"></ColumnDefinition>
                            <ColumnDefinition Width="400"></ColumnDefinition>
                            <ColumnDefinition Width="*"></ColumnDefinition>
                        </Grid.ColumnDefinitions>

                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"></RowDefinition>
                            <RowDefinition Height="250"></RowDefinition>
                            <RowDefinition Height="*"></RowDefinition>
                        </Grid.RowDefinitions>

                        <Rectangle Grid.RowSpan="3" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                            <Rectangle.Fill>
                                <SolidColorBrush Color="Gray" Opacity="0.5"/>
                            </Rectangle.Fill>
                        </Rectangle>

                        <Border Background="{TemplateBinding Background}" Grid.Row="1" Grid.Column="1">
                            <Border.Effect>
                                <DropShadowEffect ShadowDepth="2" BlurRadius="10"/>
                            </Border.Effect>
                        </Border>
                        <!-- not inside the above border since the shadow messes with the exit button -->
                        <Grid Background="{TemplateBinding Background}" Grid.Row="1" Grid.Column="1">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="13"></RowDefinition>
                                    <RowDefinition Height="*"></RowDefinition>
                                </Grid.RowDefinitions>
                            <local:ImageButton Grid.Row="0" HorizontalAlignment="Right" Image="/TM.PowerPointController.Server;component/Resource/exit.png" HoverImage="/TM.PowerPointController.Server;component/Resource/exit_highlighted.png" Height="7" Width="8" Margin="0,3,8,0" x:Name="PART_CloseButton" />
                                <ContentControl Content="{TemplateBinding Content}" Grid.Row="1"/>
                            </Grid>
                        
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
